package moa.streams.generators;

import moa.options.FloatOption;
import moa.streams.generators.AgrawalSrikantSequenceGenerator;
import weka.core.Instance;
import moa.core.MiscUtils;
public class AgrawalSrikantSequenceGeneratorDrift extends AgrawalSrikantSequenceGenerator{

    public FloatOption speedChangeOption = new FloatOption("speedChange", 'a',
            "Speed of change of potentially large sequences in the model.",
0.01, 0, Float.MAX_VALUE);
 
    
    @Override
    public Instance nextInstance() {
           //Update Large Sequence
           if (MiscUtils.uniformDistribution(this.streamRandom) <
        		 this.speedChangeOption.getValue()) {
                 //Add a new row to the table and delete old row one
        	    //int indexSequenceChoosed = super.chooseSequence(this.tableMaximalPotentiallyLargeSequences);
        	    this.tableMaximalPotentiallyLargeSequences.replaceRow
        	    ((double) this.correlationLevelSeqOption.getValue(), 
        	    		(double) this.averageSizeMaximalPotentiallyLargeSequencesOption.getValue(), 
        	    		(int) this.tableMaximalPotentiallyFrequentItemsets.getSize(), 
        	    		streamRandom
        	    );
                 System.out.println("add a new row and delete old row");
            }
            return super.nextInstance();
    }
 
}
